// RootFolder.h

#ifndef __ROOT_FOLDER_H
#define __ROOT_FOLDER_H



#include "IFolder.h"

namespace Common
{
namespace FileSystem
{

const int kNumRootFolderItems =
  #ifdef UNDER_CE
  1
  #else
  4
  #endif
  ;


class ATL_NO_VTABLE CRootFolder:
  public IFolderFolder,
  public IFolderGetSystemIconIndex,
  public CComObjectRootEx<CComSingleThreadModel>
{
  CString _names[kNumRootFolderItems];
  int _iconIndices[kNumRootFolderItems];

public:
  
	BEGIN_COM_MAP(CRootFolder)
		COM_INTERFACE_ENTRY(IFolderFolder)
		COM_INTERFACE_ENTRY(IFolderGetSystemIconIndex)
	END_COM_MAP()



	DECLARE_PROTECT_FINAL_CONSTRUCT()

	HRESULT FinalConstruct()
	{
		//Separate object creation from init
		//Init();
		return S_OK;
	}

	void FinalRelease()
	{

	}
  //INTERFACE FolderFolder
	STDMETHOD(LoadItems)() ;
	STDMETHOD(GetNumberOfItems)(UINT32 *numItems) ;
	STDMETHOD(GetProperty)(UINT32 itemIndex, PROPID propID, PROPVARIANT *value) ;
	STDMETHOD(BindToFolder)(UINT32 index, IFolderFolder **resultFolder) ;
	STDMETHOD(BindToFolder)(const wchar_t *name, IFolderFolder **resultFolder) ;
	STDMETHOD(BindToParentFolder)(IFolderFolder **resultFolder) ;
	STDMETHOD(GetNumberOfProperties)(UINT32 *numProperties) ;
	STDMETHOD(GetPropertyInfo)(UINT32 index, BSTR *name, PROPID *propID, VARTYPE *varType) ;
	STDMETHOD(GetFolderProperty)(PROPID propID, PROPVARIANT *value) ;

  STDMETHOD(GetSystemIconIndex)(UINT32 index, INT32 *iconIndex);
  HRESULT Init();
};

}
}

#endif
